home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / lisp / wgdb-42.lha / wgdb-4.2 / bfd / libcoff.h < prev    next >
C/C++ Source or Header  |  1992-09-11  |  4KB  |  171 lines

  1. /* BFD COFF object file private structure.
  2.    Copyright (C) 1990-1991 Free Software Foundation, Inc.
  3.    Written by Cygnus Support.
  4.  
  5. This file is part of BFD, the Binary File Descriptor library.
  6.  
  7. This program is free software; you can redistribute it and/or modify
  8. it under the terms of the GNU General Public License as published by
  9. the Free Software Foundation; either version 2 of the License, or
  10. (at your option) any later version.
  11.  
  12. This program is distributed in the hope that it will be useful,
  13. but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. GNU General Public License for more details.
  16.  
  17. You should have received a copy of the GNU General Public License
  18. along with this program; if not, write to the Free Software
  19. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  20.  
  21.  
  22. /* Object file tdata; access macros */
  23.  
  24. #define coff_data(bfd)        ((coff_data_type *) ((bfd)->tdata))
  25. #define exec_hdr(bfd)        (coff_data(bfd)->hdr)
  26. #define obj_symbols(bfd)    (coff_data(bfd)->symbols)
  27. #define    obj_sym_filepos(bfd)    (coff_data(bfd)->sym_filepos)
  28.  
  29. #define obj_relocbase(bfd)    (coff_data(bfd)->relocbase)
  30. #define obj_raw_syments(bfd)    (coff_data(bfd)->raw_syments)
  31. #define obj_convert(bfd)    (coff_data(bfd)->conversion_table)
  32. #if CFILE_STUFF
  33. #define obj_symbol_slew(bfd)    (coff_data(bfd)->symbol_index_slew)
  34. #else
  35. #define obj_symbol_slew(bfd) 0
  36. #endif
  37. #define obj_string_table(bfd)    (coff_data(bfd)->string_table)
  38.  
  39. #if 0
  40. typedef struct coff_ptr_struct
  41. {
  42.   unsigned int offset;
  43.   char fix_tag;
  44.   char fix_end;
  45.   union {
  46.     union internal_auxent auxent;
  47.     struct internal_syment syment;
  48.   } u;
  49. } combined_entry_type;
  50.  
  51.  
  52. typedef struct 
  53. {
  54.   asymbol symbol;
  55.   combined_entry_type *native;
  56.   struct lineno_cache_entry *lineno;
  57. } coff_symbol_type;
  58. #endif
  59.  
  60. /* `Tdata' information kept for COFF files.  */
  61.  
  62. typedef struct coff_tdata
  63. {
  64.   struct   coff_symbol_struct *symbols;    /* symtab for input bfd */
  65.   unsigned int *conversion_table;
  66.   file_ptr sym_filepos;
  67.  
  68.   long symbol_index_slew;    /* used during read to mark whether a
  69.                    C_FILE symbol as been added. */
  70.  
  71.   struct coff_ptr_struct *raw_syments;
  72.   struct lineno *raw_linenos;
  73.   unsigned int raw_syment_count;
  74.   char *string_table;
  75.   unsigned short flags;
  76.  
  77.   /* These are only valid once writing has begun */
  78.   long int relocbase;
  79.  
  80.   /* These members communicate important constants about the symbol table
  81.      to GDB's symbol-reading code.  These `constants' unfortunately vary
  82.      from coff implementation to implementation...  */
  83.   unsigned local_n_btmask;
  84.   unsigned local_n_btshft;
  85.   unsigned local_n_tmask;
  86.   unsigned local_n_tshift;
  87.   unsigned local_symesz;
  88.   unsigned local_auxesz;
  89.   unsigned local_linesz;
  90. } coff_data_type;
  91.  
  92. /* We take the address of the first element of a asymbol to ensure that the
  93.  * macro is only ever applied to an asymbol.  */
  94. #define coffsymbol(asymbol) ((coff_symbol_type *)(&((asymbol)->the_bfd)))
  95.  
  96.  
  97.  
  98. /*THE FOLLOWING IS EXTRACTED FROM THE SOURCE*/
  99.  
  100. /*:coffcode.h*/
  101.  
  102. /*
  103. The hidden information for an asymbol is:
  104. */
  105.  
  106.  typedef struct coff_ptr_struct
  107.  {
  108.  
  109. /*
  110. Remembers the offset from the first symbol in the file for this
  111. symbol. Generated by @code{coff_renumber_symbols}.
  112. */
  113.  
  114.    unsigned int offset;
  115.  
  116. /*
  117. Should the tag field of this symbol be renumbered.
  118. Created by @code{coff_pointerize_aux}.
  119. */
  120.  
  121.    char fix_tag;
  122.  
  123. /*
  124. Should the endidx field of this symbol be renumbered.
  125. Created by @code{coff_pointerize_aux}.
  126. */
  127.  
  128.    char fix_end;
  129.  
  130. /*
  131. The container for the symbol structure as read and translated from the file.
  132. */
  133.  
  134.    union {
  135.      union internal_auxent auxent;
  136.      struct internal_syment syment;
  137.    } u;
  138.  } combined_entry_type;
  139.  
  140. /*
  141.  
  142. Each canonical asymbol really looks like this:
  143. */
  144.  
  145.  typedef struct coff_symbol_struct
  146.  {
  147.  
  148. /*
  149. The actual symbol which the rest of BFD works with
  150. */
  151.  
  152.    asymbol symbol;
  153.  
  154. /*
  155. A pointer to the hidden information for this symbol
  156. */
  157.  
  158.    combined_entry_type *native;
  159.  
  160. /*
  161. A pointer to the linenumber information for this symbol
  162. */
  163.  
  164.    struct lineno_cache_entry *lineno;
  165.  } coff_symbol_type;
  166.  
  167. /*
  168. */
  169.  
  170.  
  171.